from hashlib import sha256
from typing import Any

class Hash:
    def __init__(self, init: Any = None):
        self._sha256 = sha256()
        if init is not None:
            self.update(init)

    def update(self, value: Any):
        self._sha256.update(str(value).encode('gb18030'))
        return self

    def value(self) -> str:
        return self._sha256.hexdigest()
